import { http } from '@/utils/request'

// 修改学校
export function updateSchool(data: any) {
  return http.request({
    url: `/small/mySchool/updateSchool`,
    method: 'POST',
    data
  })
}

// 解绑成员
export function unBindMemberSchoolRelation(data: any) {
  return http.request({
    url: `/small/mySchool/unBindMemberSchoolRelation`,
    method: 'POST',
    data
  })
}

// 绑定成员
export function bindMemberSchoolRelation(data: any) {
  return http.request({
    url: `/small/mySchool/bindMemberSchoolRelation`,
    method: 'POST',
    data
  })
}

// 添加学校
export function addSchool(data: any) {
  return http.request({
    url: `/small/mySchool/addSchool`,
    method: 'POST',
    data
  })
}

// 全部学校列表
export function selectSchoolList(params: any) {
  return http.request({
    url: `/small/mySchool/selectSchoolList`,
    method: 'GET',
    params
  })
}

// 学校详情
export function selectSchoolDetail(schoolId: string | number) {
  return http.request({
    url: `/small/mySchool/selectSchoolDetail/${schoolId}`,
    method: 'GET'
  })
}

// 通过学校数量
export function selectMySchoolNumber() {
  return http.request({
    url: `/small/mySchool/selectMySchoolNumber`,
    method: 'GET'
  })
}

// 我的学校列表
export function selectMySchoolList(params: any) {
  return http.request({
    url: `/small/mySchool/selectMySchoolList`,
    method: 'GET',
    params
  })
}

// 我的家庭成员列表
export function selectMyFamilyMemberListBySchool(schoolId: string | number) {
  return http.request({
    url: `/small/mySchool/selectMyFamilyMemberList/${schoolId}`,
    method: 'GET'
  })
}

// 加入学校
export function joinSchool(schoolId: string | number) {
  return http.request({
    url: `/small/mySchool/joinSchool/${schoolId}`,
    method: 'GET'
  })
}

// 删除学校
export function deleteSchool(id: string | number) {
  return http.request({
    url: `/small/mySchool/deleteSchool/${id}`,
    method: 'DELETE'
  })
}
